/*
 * BIT READER
 * Streams over bits held as byte data in memory.
 * Word-based is faster but offers endianness complexities,
 * so this is char-based.
 */

#ifndef __KEW_BITREADER_H__
#define __KEW_BITREADER_H__

#include <kew/kew.h>

typedef struct _KewBitReader KewBitReader;

KEW_EXPORT KewBitReader *kew_bit_reader_new(gchar *data, unsigned size_in_bytes);

/* FIXME: I think this may be unused */
KEW_EXPORT void kew_bit_reader_align_byte(KewBitReader *bit_reader);

KEW_EXPORT gboolean kew_bit_reader_empty(KewBitReader *bit_stream);

KEW_EXPORT unsigned kew_bit_reader_read(KewBitReader *bit_stream);

KEW_EXPORT unsigned kew_bit_reader_read_n(KewBitReader *bit_stream, unsigned bits_to_read);

#endif